package com.hellobike.haxing.convert;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hellobike.haxing.product.model.vo.ProductVo;

import com.hellobike.haxing.response.shop.ProductListVo;
import com.hellobike.haxing.search.vo.SearchMarketingTagVo;
import com.hellobike.haxing.search.vo.SearchProductVo;
import com.hellobike.haxing.search.vo.SearchSpecificationVo;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.regex.Pattern;

public class ProductInfoConvert {
    private final static Pattern pattern = Pattern.compile(".+(\\.mp4|\\.3gp|\\.m3u8)$");


    public static void convert(SearchProductVo productVo, ProductListVo productListVo) {
        productListVo.setDimensions(productVo.getDimensions());
        productListVo.setId(productVo.getId());
        if (!CollectionUtils.isEmpty(productVo.getMarketingTagList())) {
            productListVo.setMarketingTagVo(productVo.getMarketingTagList().get(0));
        }
        productListVo.setSkuList(productVo.getSkuList());
        productListVo.setSold(productVo.getSold());
        productListVo.setTitle(productVo.getTitle());
        productListVo.setType(productVo.getType());
        productListVo.setState(productVo.getState());
        productListVo.setSize(productVo.getSize());
        productListVo.setSkuList(productVo.getSkuList());
        productListVo.setMainImage(productVo.getMainImage());
        productListVo.setDimensions(productVo.getDimensions());
        productListVo.setSubTitle(productVo.getSubTitle());
        productListVo.setMinPrice(productVo.getMinPrice());
        productListVo.setMinPromotionPrice(productVo.getMinPromotionPrice());
    }
}
